<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
  <head>
    <link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
    <link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
    <style>
      *{
        <#if .locale == "zh_CN">
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        <#elseif .locale == "zh_TW">
        font-family: NotoSans, NotoSansCJKtc, sans-serif;
        <#elseif .locale == "ja_JP">
        font-family: NotoSans, NotoSansCJKjp, sans-serif;
        <#elseif .locale == "ko_KR">
        font-family: NotoSans, NotoSansCJKkr, sans-serif;
        <#elseif .locale == "th_TH">
        font-family: NotoSans, NotoSansThai, sans-serif;
        <#else>
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        </#if>
      }

      body {
        width: 21.5cm;
        height: 14cm;
        margin: 0;
        padding: 0;
        background-color: #FFFFFF;
        text-align: center;
      }
      table {
        table-layout:fixed;
        margin: 0 5px;
      }
      table td {
        font-size: 12px;
        height: 20px;
        text-align: center;
        word-wrap: break-word;
         word-break: break-all; 
      }
      table td p {
        width: 100%;
        /*height: auto;*/
        color: #000;
      }
      table .td1 {
        width: 5%;
      }
      table .td2 {
        width: 10%;
      }
      table .td3 {
        width: 10%;
      }
      table .td4 {
        width: 15%;
      }
      table .td5 {
        width: 10%;
      }
      table .td6 {
        width: 10%;
      }
      table .td7 {
        width: 5%;
      }
      table .td8 {
        width: 5%;
      }
      table .td9 {
        width: 10%;
      }
      table .td10 {
        width: 5%;
      }
      table .td11 {
        width: 15%;
      }
      .leftBorder {
        border-left: 1px solid #000000;
      }
      .rightBorder {
        border-right: 1px solid #000000;
      }
      .topBorder {
        border-top: 1px solid #000000;
      }
      .bottomBorder {
        border-bottom: 1px solid #000000;
      }
      .border {
        border: 1px solid #000000;
      }
    </style>
  </head>
  <body>
  <#assign pageSize=((invTransfer.transferDetail?size)/5)?ceiling ?number>

  <#list 1..pageSize as i>
  <#if i <= pageSize >
  <div style="height:100%">
  <table cellspacing="0" cellpadding="0" width="100%">
    <tr>
      <td  class="td1"></td>
      <td  class="td2"></td>
      <td  class="td3"></td>
      <td  class="td4"></td>
      <td  class="td5"></td>
      <td  class="td6"></td>
      <td  class="td7"></td>
      <td  class="td8"></td>
      <td  class="td9"></td>
      <td  class="td10"></td>
      <td  class="td11"></td>
    </tr>
    <tr>
      <td colspan="11">
        <p style="text-align: center;font-size: 30px;font-weight: 600;line-height: 30px;">
          库存转移单
        </p>
      </td>
    </tr>
    <tr>
      <td colspan="11">
        <p style="text-align: right; font-size: 20px;font-weight: 600; ">
          — — — ${invTransfer.subsidiary}
        </p>
      </td>
    </tr>
    <tr>
      <td colspan="5">
        <p style="text-align: left;font-size: 14px;line-height: 14px;">
          部门:&nbsp;&nbsp;<u>${invTransfer.department}</u>
        </p>
      </td>
      <td colspan="6">
        <p style="text-align: right;font-size: 14px;line-height:14px;">
          转移日期：${invTransfer.date}
        </p>
        <p style="text-align: right;font-size: 14px;line-height:14px;">
          NO: ${invTransfer.tranid}
        </p>
      </td>
    </tr>
    <tr>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">序号</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">调出</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">调入</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">产品描述</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">物料编码</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">规格</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">颜色</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">色号</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">数量</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">单位</p>
      </td>
      <td class="leftBorder topBorder rightBorder">
        <p style="text-align: center; font-size: 14px;font-weight: 600; ">备注</p>
      </td>
    </tr>
    <#assign totalQty=0?number>
    <#list invTransfer.transferDetail as transferLine>
    <#if (transferLine_index+1) gt 5*(i-1) && (transferLine_index+1) lte 5*i>
    <#assign totalQty = totalQty + transferLine.quantity?number>

    <tr>
      <td class="td1 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.lineNumber}</p>
      </td>
      <td class="td2 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${invTransfer.fromLocation}</p>
      </td>
      <td class="td3 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${invTransfer.toLocation}</p>
      </td>
      <td class="td4 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.itemName}</p>
      </td>
      <td class="td5 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.item}</p>
      </td>
      <td class="td6 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.size}</p>
      </td>
      <td class="td7 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.color}</p>
      </td>
      <td class="td8 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.colorNumber}</p>
      </td>
      <td class="td9 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.quantity}</p>
      </td>
      <td class="td10 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.unit}</p>
      </td>
      <td class="td11 leftBorder topBorder rightBorder">
        <p style="text-align: center;font-size: 14px; ">${transferLine.memo}</p>
      </td>
    </tr>
    </#if>
    </#list>
  <#if i=pageSize && (invTransfer.transferDetail?size)%5 != 0>
  <#list 1..(5-((invTransfer.transferDetail?size)%5)) as j>
  <#if j <= (5-((invTransfer.transferDetail?size)%5)) >
        <tr>
      <td class="td1 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${invTransfer.transferDetail?size + j}</p>
      </td>
      <td class="td2 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "> </p>
      </td>
      <td class="td3 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td4 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td5 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td6 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td7 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td8 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td9 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td10 leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
      <td class="td11 leftBorder topBorder rightBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
    </tr>
      </#if>
    </#list>
   </#if>
<tr>
  <td class="leftBorder topBorder" colspan="8">
    <p style="text-align: center;font-size: 14px; ">小计</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 14px; ">${totalQty}</p>
  </td>
  <td class="leftBorder topBorder">
    <p style="text-align: center;font-size: 14px; ">${invTransfer.currency}</p>
  </td>
  <td class="leftBorder topBorder rightBorder">
    <p style="text-align: center;font-size: 14px; "></p>
  </td>
</tr>
    <tr>
      <td class="leftBorder topBorder" colspan="8">
        <p style="text-align: center;font-size: 14px; ">总计</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${invTransfer.totalQty}</p>
      </td>
      <td class="leftBorder topBorder">
        <p style="text-align: center;font-size: 14px; ">${invTransfer.currency}</p>
      </td>
      <td class="leftBorder topBorder rightBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
    </tr>
    <tr>
      <td class="leftBorder topBorder rightBorder" colspan="11">
        <p style="width: 90%;text-align: right;font-size: 14px; ">打印次数：${invTransfer.printTimes} 次</p>
      </td>
    </tr>
    <tr>
      <td class="leftBorder topBorder bottomBorder" colspan="10">
        <table style="width: 100%;margin: 0;">
          <tr>
            <td colspan="4">
              <p style="text-align:left;font-size: 14px; ">备注:${invTransfer.memo}</p>
            </td>
          </tr>
          <tr>
            <td>
              <p style="text-align:left;font-size: 14px; ">制表人:</p>
            </td>
            <td>
              <p style="text-align:left;font-size: 14px; ">发料人:</p>
            </td>
            <td>
              <p style="text-align:left;font-size: 14px; ">部门主管:</p>
            </td>
            <td>
              <p style="text-align:left;font-size: 14px; ">财务部:</p>
            </td>
          </tr>
        </table>
      </td>
      <td class="leftBorder topBorder rightBorder bottomBorder">
        <p style="text-align: center;font-size: 14px; "></p>
      </td>
    </tr>
    <tr>
      <td colspan="11">
        <p style="text-align: left;font-size: 14px; ">
          对加工商产生约束力之任何法律文件，均须经加工负责人或授权人签字方可生效
          <br />
          一式四联：第一联（白）：仓库留存联；第二联（蓝）：会计记账；第三联（黄）：加工商留存联；第四联（红）：收货部门留存
        </p>
      </td>
    </tr>
<tr>
  <td colspan="11">
    <p style="text-align: center;font-size: 14px; ">
      ${i} / ${pageSize}
    </p>
  </td>
</tr>
  </table>
</div>
</#if>
</#list>
  </body>
</pdf>